package main;

import java.util.ArrayList;



public class Player {
	
	String name;
	ArrayList<RPSEnum> moves;
	int score;

	final static int COLLEC=5;
	
	
	public Player(String name, ArrayList<RPSEnum> liste)
	{
		this.name=name;
		this.moves=liste;
		score=0;
		
		
	
	}

	public Player(String name)
	{
		this.name=name;
		this.moves=generateMoves();
		score=0;
	}
	
	public RPSEnum getNextMove(int tour)
	{
		if (this.moves.get(0)==null) System.out.println("null probleme liste");
		return this.moves.get(tour);
	}
	
	
	ArrayList<RPSEnum> generateMoves()
	{
		ArrayList<RPSEnum> liste= new ArrayList<RPSEnum>();
		
		
		int alea=0;
		
		for(int i=0; i<COLLEC; i++)
		{
		alea=(int)(Math.random()*2.99);
		switch(alea)
		{
		case 0:
			liste.add(RPSEnum.ROCK);
			break;
			
		case 1:
			liste.add(RPSEnum.PAPER);
			break;
			
		case 2:
			liste.add(RPSEnum.SCISSORS);
			break;
			
		}
		}
		
		return liste;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the score
	 */
	public int getScore() {
		return score;
	}


	/**
	 * @param score the score to set
	 */
	public void setScore(int score) {
		this.score = score;
	}


	
}
